import axios from "axios";

const Server = axios.create({
    baseURL: 'http://123.57.143.201:8888/api/private/v1/',
    timeout: 5000,
});


Server.interceptors.request.use(function (config) {
    var token=localStorage.getItem('token')
    if(token){
        config.headers.common['Authorization'] = token;
    }
    return config;
}, function (error) {
    
    return Promise.reject(error);
});


Server.interceptors.response.use(function (response) {

    return response.data;
}, function (error) {

    return Promise.reject(error);
});

export default Server